
import { dictionaryREQ } from '@/api/dictionary'

export default {
  state: { dictionaryData: [] },
  getters: {
    dictionaryKey: (state, getters, rootState) => key => {
      const dic = state.dictionaryData[key]
      if (dic) return dic
      dictionaryREQ().then(res => {
        state.dictionaryData = res
        return res[key]
      })
    }
  },
  mutations: {
  },
  actions: {}
}
